home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Source Code / Libraries / c++advio 2.3 / Advanced i⁄o / Makefile < prev    next >
Encoding:
Makefile  |  1997-03-04  |  2.4 KB  |  110 lines  |  [TEXT/unix]

  1. #                Makefile
  2. #         to build and test my working environment
  3. #    (including my i/o library and an arithmetic coding classlib)
  4. #
  5. # To build the library, you may want to edit the list of the library modules
  6. # below (MODULES). Say, if you don't need/want voc, remove all the names
  7. # that contain voc from MODULES= below. Then make the modules you left
  8. # into the library by
  9. #        make lib
  10. # simple 'make' would suffice, too.
  11. #
  12. # To verify the library, do
  13. #    make check-all
  14. # or, more specifically,
  15. #    make vmyenv        (checks myemnv utility functions)
  16. #    make vendian_io        (checks Endion I/O and bitstream i/o)
  17. #    make varithm        (checks arithmetic compression/decompression)
  18. #    make vhistogram        (checks histogram operations)
  19. #
  20. # Note, this Makefile was built (and works under) GNU make 3.71
  21. #
  22. # Please check RANLIB below and adjust it to your system if necessary
  23. # (it was made for a BSD-like system)
  24. #
  25. CC=$(HOME)/bin/c++
  26. CCL=$(HOME)/bin/c++l
  27. .SUFFIXES: .cc
  28. MODULES=sys_open.cc filebuf.cc myenv.cc endian_io.cc \
  29.     arithm_coding.cc arithm_model.cc arithm_modadapt.cc \
  30.     arithm_modadh.cc histogram.cc \
  31.     voc.cc voc_io.cc
  32.  
  33. LIBRARY=libserv.a
  34. #RANLIB = (ar d $(LIBRARY) __.SYMDEF || true); ranlib $(LIBRARY) # for BSD
  35. RANLIB = /bin/true     # for Solaris 2.x, HP/UX and other SysV-based
  36.  
  37.  
  38. #    Rules, new style
  39.  
  40. %.o : %.cc
  41.     $(CC) $*.cc
  42.  
  43. % : %.o $(LIBRARY)
  44.     $(CCL) $< $(LIBRARY) -o $@
  45.     ./$@
  46.  
  47. % :: %.cc
  48.     $(CC) $*.cc
  49.     $(CCL) $*.o $(LIBRARY) -o $@
  50.     ./$@
  51.  
  52. #    Rules, old style
  53. #.o:    $*.o $(LIBRARY)
  54. #    $(CCL) $*.o $(LIBRARY) -o $*
  55. #    ./$*
  56. #.cc:     $*.cc $(LIBRARY)
  57. #    $(CC) $*.cc
  58. #    $(CCL) $*.o $(LIBRARY) -o $*
  59. #    ./$*
  60. #.cc.o:
  61. #    $(CC) $*.cc
  62. #
  63.  
  64. # Primary goal
  65.  
  66. # Library
  67.  
  68. lib:    $(LIBRARY)
  69. .PHONY:     lib
  70. .PRECIOUS:    $(LIBRARY)
  71.  
  72. $(LIBRARY)::    $(MODULES)
  73. #             Compile the source files that have been changed 
  74.     $(CC) $?
  75.     listobj=`echo $? | sed s/.cc/.o/g` ; \
  76.     ar rv $(LIBRARY) $$listobj &&    \
  77.     rm $$listobj
  78.     $(RANLIB)
  79.  
  80. # Verification routines
  81. check-all:    vmyenv vendian_io varithm vhistogram
  82.  
  83. clean:
  84.     rm -f core vmyenv.o vmyenv vendian_io.o vendian_io varithm.o varithm \
  85.     vhistogram.o vhistogram
  86.  
  87. dist-clean:    clean
  88.     rm -f $(LIBRARY)
  89.  
  90. #vendian_io:    vendian_io.o $(LIBRARY)
  91. #    $(CCL) vendian_io.o  $(LIBRARY) -o vendian_io
  92. #    ./vendian_io
  93.  
  94. # Specific dependent goals
  95.  
  96.  
  97. # Dependence rules
  98.  
  99. $(LIBRARY)::    myenv.h
  100.     $(MAKE) -W myenv.cc lib
  101.  
  102. vendian_io.o:    endian_io.h
  103.  
  104. $(LIBRARY)::    arithm.h
  105.     $(MAKE) -W arithm_coding.cc lib
  106.     $(MAKE) -W arithm_model.cc lib
  107. $(LIBRARY)::    arithm.h arithm_modadh.h
  108.     $(MAKE) -W arithm_modadh.cc lib
  109.  
  110.